<template>
  <div class="mobile-validate">
    <div class="validate-container">
      <div class="number-container">
        <span>手机号：</span>
        <input placeholder="手机号" type="number" v-model="mobileNumber">
      </div>
      <div class="code-container">
        <span>验证码：</span>
        <input type="text" placeholder="验证码" v-model="validateCode">
        <a href="" @click.prevent="sendCode">发送短信</a>
      </div>
      <a class="validate-confirm" @click.prevent="onConfirm">确认</a>
    </div>

  </div>
</template>
<script>
import { Toast } from "mint-ui";
export default {
  data() {
    return {
      mobileNumber: "",
      validateCode: ""
    };
  },
  methods: {
    sendCode() {
      if (this.mobileNumber === "") {
        Toast("请输入手机号");
        return;
      }
    },
    onConfirm() {
      if (this.validateCode === "") {
        Toast("请输入正确的验证码");
        return;
      }
      this.$emit('callback')
    }
  }
};
</script>
<style lang="scss" scoped>
.mobile-validate {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 100;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
}
.validate-container {
  height: 235px;
  width: 335;
  background-color: white;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
.number-container {
  display: flex;
  flex-direction: row;
  margin: 40px 20px 0;
  span {
    color: rgb(28, 28, 28);
    font-size: 15px;
    line-height: 15px;
    align-self: flex-end;
  }
  input {
    margin-left: 12px;
    color: rgb(28, 28, 28);
    font-size: 15px;
    width: 105px;
    border: none;
    border-bottom: 1px solid rgb(204, 204, 204);
    outline: none;
  }
}
.code-container {
  display: flex;
  flex-direction: row;
  margin: 32px 20px 0;
  span {
    color: rgb(28, 28, 28);
    font-size: 15px;
    align-self: flex-end;
    line-height: 15px;
  }
  input {
    border: none;
    margin-left: 12px;
    align-self: flex-end;
    color: rgb(28, 28, 28);
    font-size: 15px;
    width: 105px;
    outline: none;
    border-bottom: 1px solid rgb(204, 204, 204);
  }
  a {
    border: 1px solid rgb(0, 0, 0);
    width: 109px;
    height: 44px;
    color: black;
    text-align: center;
    line-height: 44px;
    border-radius: 44px;
  }
}
.validate-confirm {
  margin: 20px;
  color: white;
  border-radius: 45px;
  text-align: center;
  line-height: 45px;
  height: 45px;
  margin-top: 34px;
  margin-bottom: 20px;
  background-color: rgb(255, 163, 47);
}
</style>
